// 用户个人资料

var MyData = Vue.component('MyData', {
    // router,
    data () {
        return {
            curLink: 'base',
            linkArr: [
                {
                    name: '基本信息',
                    linkName: 'base',
                    link: '/data/base'
                }, {
                    name: '扩展信息',
                    linkName: 'expansion',
                    link: '/data/expansion'
                }, {
                    name: '个人认证',
                    linkName: 'certification',
                    link: '/data/certification'
                }, {
                    name: '登录设置',
                    linkName: 'setting',
                    link: '/data/setting'
                }
            ]
        }
    },
    props: [''],
    // 周期
    created: function () {},
    mounted() {},
    methods: {
        onSLink (_value) {
            this.curLink = _value
            this.$router.push({path:'/data/'+_value})
        }
    },
    template: `<div class="">
                    <div class="router-data-link">
                        <div class="data-link" 
                            v-for="(item, index) in linkArr" 
                            :key="index" 
                            :class="{active: curLink == item.linkName}"  
                            @click="onSLink(item.linkName)">
                            <router-link :to="item.link">{{item.name}}</router-link>
                        </div>
                    </div>
                    <div class="router-data-view">
                        <router-view class="router-data"></router-view>
                    </div>
                </div>`
})